package com.wing.cabinet.model.entity;

import java.io.Serializable;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.core.enums.IEnum;
import com.wing.mybatis.common.BaseEntity;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

/**
 * 上货计划
 *
 * @author
 */
@Data
@NoArgsConstructor
@Accessors(chain = true)
@TableName("cab_cabinet_load_plan")
public class CabinetLoadPlan extends BaseEntity<CabinetLoadPlan> implements Serializable {

    private static final long serialVersionUID = 1L;

    public enum Type implements IEnum<Integer> {

        /**
        * 补货上货
        */
        replenishment(0,"补货上货"),
        /**
        * 自主上货
        */
        selfLoad(1,"自主上货");

        private int code;
        private String desc;

        Type(int code,String desc){
            this.code=code;
            this.desc=desc;
        }

        @Override
        public Integer getValue(){
            return this.code;
        }

        public String getDesc(){
            return this.desc;
        }
    }

    public enum Status implements IEnum<Integer> {

        /**
        * 待审核
        */
        stayAudit(0,"待审核"),
        /**
        * 审核通过
        */
        pass(1,"审核通过"),
        /**
        * 审核失败
        */
        fail(2,"审核失败");

        private int code;
        private String desc;

        Status(int code,String desc){
            this.code=code;
            this.desc=desc;
        }

        @Override
        public Integer getValue(){
            return this.code;
        }

        public String getDesc(){
            return this.desc;
        }
    }

    public enum State implements IEnum<Integer> {

        /**
         * 0.初始值
         */
        created(0,"初始值"),
        /**
         * 出库作业完成
         */
        invnetoryOutFinish(1,"出库作业完成"),
        /**
         * 领货完成
         */
        receiveFinish(2,"领货完成"),
        /**
         * 上货完成
         */
        loadFinish(3,"上货完成");

        private int code;
        private String desc;

        State(int code,String desc){
            this.code=code;
            this.desc=desc;
        }

        @Override
        public Integer getValue(){
            return this.code;
        }

        public String getDesc(){
            return this.desc;
        }
    }

    /**
     * 创建者
     */
    private Long creator;

    /**
     * 修改者
     */
    private Long modifier;

    /**
     * 创建人
     */
    private String creatorName;

    /**
     * 修改人
     */
    private String modifierName;

    /**
     * 编号
     */
    private String code;

    /**
     * 类型
     */
    private Type type;

    /**
    * 类型描述
    */
    @TableField(exist = false)
    private String typeDesc;

    public String getTypeDesc() {
        return type == null ? null : type.getDesc();
    }

    /**
     * 状态
     */
    private Status status;

    /**
    * 状态描述
    */
    @TableField(exist = false)
    private String statusDesc;

    public String getStatusDesc() {
        return status == null ? null : status.getDesc();
    }

    /**
     * 配货需求订单ID
     */
    private Long distributionDemandId;

    /**
     * 入驻企业ID
     */
    private Long companyId;

    /**
     * 接入刀柜ID
     */
    private Long cabinetId;

    /**
     * 领货仓库ID
     */
    private Long warehouseId;

    private State state;

    /**
     * 企业编码
     */
    private String enterpriseCode;

}
